package model.model01.demo03.utils.factory;

import com.model.model01.demo03.utils.Operate;
import com.model.model01.demo03.utils.operate.AddOperate;
import com.model.model01.demo03.utils.operate.SubOperate;

public class OperateFactory {

    public static Operate createOperate(String operate) {
        Operate oper = null;
        switch (operate) {
            case "+" : oper = new AddOperate(); break;
            case "-" : oper = new SubOperate(); break;
            default: System.out.println("暂不支持运算符");
        }

        return oper;
    }
}
